export class UIUtils {
  static showLoading(message: string) {
    const loadingElement = document.createElement('div');
    loadingElement.id = 'loading';
    loadingElement.innerText = message;
    loadingElement.style.position = 'fixed';
    loadingElement.style.top = '50%';
    loadingElement.style.left = '50%';
    loadingElement.style.transform = 'translate(-50%, -50%)';
    loadingElement.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
    loadingElement.style.color = 'white';
    loadingElement.style.padding = '10px 20px';
    loadingElement.style.borderRadius = '5px';
    document.body.appendChild(loadingElement);
  }

  static hideLoading() {
    const loadingElement = document.getElementById('loading');
    if (loadingElement) {
      document.body.removeChild(loadingElement);
    }
  }

  static showToast(message: string, type: 'success' | 'error') {
    const toastElement = document.createElement('div');
    toastElement.innerText = message;
    toastElement.style.position = 'fixed';
    toastElement.style.bottom = '20px';
    toastElement.style.left = '50%';
    toastElement.style.transform = 'translateX(-50%)';
    toastElement.style.backgroundColor = type === 'success' ? '#67c23a' : '#f56c6c';
    toastElement.style.color = 'white';
    toastElement.style.padding = '10px 20px';
    toastElement.style.borderRadius = '5px';
    toastElement.style.zIndex = '1000';
    document.body.appendChild(toastElement);
    setTimeout(() => {
      document.body.removeChild(toastElement);
    }, 2000);
  }
} 